package start.doubudouyin.utils;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class Webconfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 映射本地存储目录到Web路径：http://localhost:8080/contextPath/icon/**
        registry.addResourceHandler("/icon/**")
                .addResourceLocations("file:D:/Practice Project/icon/");

        // 将 /video/** 映射到 D:/Practice Project/video/ 目录
        registry.addResourceHandler("/video/**")
                .addResourceLocations("file:D:/Practice Project/video/");
    }
}